From: | Darryl Hartwig |
Date: | 01 Aug 99 at 08:30:42 |
Subject: | Re: Drawing images on Intution |
From: Darryl Hartwig <darrylh@powerup.com.au>
Hello Allan
On 31-Jul-99, Allan Odgaard wrote:
>> Is there another way without having to save the current
>> image under the new position that I want to place my
>> image?
>
> If you cannot reconstruct the background, then you must
> take a copy. But have in mind that with simple-refresh
> windows then you're not really guaranteed to actually get
> the background image, if the window is covered...
>
> How is your background generated?
The background is simply a green colour, then a whole bunch
of cards are splashed over it. I'm basically moving a card
from one column to another.
But how is the copy to be achieved? ClipBlit() only works
from one rastpart to another.
>
>> And what combination of routines can I use to set
>> up the colours I want?
>
> Unless you're opening on a custom screen, then you should
> remap your image to the screen colours, rather than
> changing them. The easy way is simply to save your image
> to disk, e.g. in IFF/ILBM, and load it with datatypes,
> asking for remapping. This will also apply dither to your
> image if the user has a V43+ picture.datatype.
>
> If you don't want to do this, then use ObtainBestPen() to
> 'allocate' colours, and remap to this, either by shufling
> around the bitplans, or have the image in a chunky format,
> and use something like WritePixelArray8() to transfer it
> to a bitmap.
I've tried using ObtainPen() and setting up the actual
colours... this worked, at least for a while (that is, got
the whole 8 colours I wanted initially, then dropped all
the way to 1).
But how is the remapping to be done? I am loading the
(IFF/ILBM) image from disk (which is an amalgamation of 52
cards - I take an offset into the imagedata to get other
cards).
Intuition takes the first nine pens (or so), using
ObtainPen() gets me pens up at the 200 level or so. If my
image data (3 deep) says to use pen 2 (for example) to
render a particular bit, instead of actually using pen 2
(which is highlight, I think), I want to use pen number 215
instead. Am I barking up the wrong tree, or is there a
simple way of doing this?
It does sound like using DataTypes is the easiest way to go.
Do you have some sample code, please?